﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ServerList.aspx.cs" Inherits="ServerList" %>

<%@ Register Src="head.ascx" TagName="Head" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>服务器操作记录工具</title>
     <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div style="vertical-align: middle; text-align: center">
    <form id="form1" runat="server">
        <table border="0" width="100%">
            <tr>
       <td style="height: 53px; width: 1109px;">
        <uc1:Head ID="Head2" runat="server" />
    </td>
       </tr>
            <tr>
                <td style="width: 1109px; font-size: 15px; font-family: 宋体;">
                    <br />
                    服务器列表<br />
                    &nbsp;<asp:GridView ID="GridView1" AllowPaging="True" runat="server" AutoGenerateColumns="False" OnPageIndexChanging="GridView1_PageIndexChanging" OnRowEditing="GridView1_RowEditing" Width="908px" OnRowDeleting="GridView1_RowDeleting">
                        <Columns>
                            <asp:BoundField DataField="server_id" HeaderText="ID" />
                            <asp:BoundField DataField="name" HeaderText="服务器名称" />
                            <asp:BoundField DataField="ip" HeaderText="IP" />
                             <asp:TemplateField HeaderText="状态">
                                 <EditItemTemplate>
                                     <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                                 </EditItemTemplate>
                                <ItemTemplate>
                                        <%# DGFormatSex(Convert.ToString(DataBinder.Eval(Container.DataItem,"status"))) %>
                                 </ItemTemplate>
                               </asp:TemplateField>
                            <asp:BoundField DataField="type" HeaderText="服务器类型" />
                            <asp:BoundField DataField="last_time" HeaderText="最新操作时间" />
                            <asp:CommandField EditText="修改" HeaderText="修改" ShowEditButton="True" ShowDeleteButton="True"/>
                        </Columns>
                    </asp:GridView>
                    <br />
                    <table id="tblLog" runat="server" border="1" cellpadding="0" cellspacing="0" width="500">
                        <tr>
                            <td colspan="2">
                                添加服务器 &nbsp;</td>
                        </tr>
                        <tr>
                            <td>
                                服务器名称：</td>
                            <td align="left" style="width: 399px">
                                &nbsp;<asp:TextBox ID="serverName" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="serverName"
                                    ErrorMessage="请输入服务器名称"></asp:RequiredFieldValidator></td>
                        </tr>
                        <tr>
                            <td>
                                服务器IP：</td>
                            <td align="left" style="width: 399px">
                                &nbsp;<asp:TextBox ID="serverIP" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="serverIP"
                                    ErrorMessage="请输入服务器IP"></asp:RequiredFieldValidator></td>
                        </tr>
                        <tr>
                            <td style="height: 24px">
                                状态：</td>
                            <td align="left" style="width: 399px; height: 24px">
                                &nbsp;<asp:DropDownList ID="DropDownList1" runat="server">
                                    <asp:ListItem Value="1">在用</asp:ListItem>
                                    <asp:ListItem Value="0">停用</asp:ListItem>
                                </asp:DropDownList></td>
                        </tr>
                        <tr>
                            <td style="height: 38px">
                                服务器类型：</td>
                            <td align="left" style="width: 399px; height: 38px">
                                &nbsp;<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td>
                                备 注：</td>
                            <td align="left" runat="server" style="width: 399px">
                                <asp:TextBox TextMode="MultiLine" ID="memo" runat="server" Height="110px" Width="401px"></asp:TextBox>
                                </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;</td>
                            <td align="left" style="width: 399px">
                                <% if (sign == 0)
                                   { %>
                                    <asp:Button ID="cmdAdd2" runat="server" Text="添加" OnClick="cmdAdd2_Click" />
                                <%}
                                  else
                                  {%>
                                   <asp:Button ID="cmdAddupdate" runat="server" Text="修改" OnClick="cmdAddupdate_Click" />
                                   <asp:HiddenField id="server_id" runat="server" />
                                   <asp:HiddenField id="create_time" runat="server" />
                               <%}%>
                               </td> 
                        </tr>
                    </table>
                    <br />
                    &nbsp;</td>
            </tr>
            <tr>
                <td style="width: 1109px">
                    &nbsp;<asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
                        ShowSummary="False" />
                </td>
            </tr>
        </table>
    </form>
  </div>
</body>
</html>
